package com.tebie.cloud.task.server.controller;

import com.tebie.cloud.task.server.service.OrderSchedulerService;
import com.tebie.cloud.task.server.service.feign.OrderServiceClient;
import com.tebiecloud.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * 订单定时任务
 */
@Component
public class OrderSchedulerController {

    @Autowired
    OrderSchedulerService orderSchedulerService;

    /**
     * 每五分钟执行一次，查询30分钟还没有支付的订单
     */
    @Scheduled(cron="0 0/5 * * * ?")
    public void orderStatusByNotPay() {
        int status = 0;//订单状态：0取消
        orderSchedulerService.doOrderStatusByNotPayJob(status);
    }

}
